<?php
  header("Content-type:text/html;charset=utf-8");
  $name = $_POST["userName"];
  $pwd = $_POST["userPwd"];
  $conn = mysql_connect("localhost","root","root");
  mysql_select_db("database_phone");
  $result = mysql_query("select * from users where username='$name' && userPwd='$pwd'");
  if(mysql_num_rows($result) == 1){
    $rows = mysql_fetch_assoc($result);
    echo $rows["id"];
  }else{
    echo "0";
  }
?>
